package com.lx.txx.dao;

import com.lx.txx.entity.TxxCar;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 天下行租车-车辆表-10 Mapper 接口
 * </p>
 *
 * @author lx
 * @since 2024-12-30
 */
public interface TxxCarMapper extends BaseMapper<TxxCar> {
    @Select("SELECT\n" +
            "	a.id,\n" +
            "	b.path \n" +
            "FROM\n" +
            "	txx_car a,\n" +
            "	txx_image b \n" +
            "WHERE\n" +
            "	a.id = b.cid \n" +
            "	AND a.id = #{id}")

//    @Results(wa
//            id = "rm1",
//            // @Many 一对多  fetchType 设置加载方式 默认积极加载
//            value = {
//                    @Result(column = "id", property = "id", id = true),
//                    @Result(column = "path", property = "path",
//                            many = @Many(select = "selectByCarId"))}
//    )
    public List<TxxCar> selectByCarId(String id);
}
